<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			// 闭包
			function test1(){
				function test2(){
					var b = 2;
					var a;
					console.log(a);
				}
				
				var a = 1;
				return test2;
			}
			
			var c = 3;
			var test3 = test1(); //test2
			test3();
		</script>
	</body>
</html>
